package org.pt.utils;

import org.springframework.stereotype.Component;

import static org.pt.config.Constants.ID_BASE;

@Component
public class IdGenerator {
    private static int counter = ID_BASE;

    private IdGenerator() {}

    public static synchronized int nextId() {
        return ++counter;
    }

    public static synchronized int getCurrentId() {
        return counter;
    }

    public static synchronized void reset() {
        counter = 0;
    }
}
